a = int(input("完数范围"))
numbers = []
# 完数
for num1 in range(1, a + 1):
    sum = 0
    for i in range(1, num1):
        if num1 % i == 0:
            sum += i
    if sum == num1:
        numbers.append(num1)
print(numbers)
# 质数
b = int(input("质素范围："))
numbers1 = []
for num1 in range(2, b + 1):
    flag = True
    for i in range(2, num1):
        if num1 % i == 0:
            flag = False
            break
    if flag:
        numbers1.append(num1)
print(numbers1)

# 菱形
n = int(input("输入行数："))
for i in range(1, 2 * ((n - 1) // 2 + 1), 2):
    print(('*' * i).center(n))
for i in range((2 * (n - 1) // 2) - 1, 0, -2):
    print(('*' * i).center(n))
# 斐波那契
m = int(input("输入斐波那契数列的位数："))
fib = [0, 1]
while len(fib) < m:
    fib.append(fib[-1] + fib[-2])
print(fib[:m])
# 乘法表
for i in range(1, 10):
    for j in range(1, i + 1):
        print("%d * %d = %d" % (j, i, j * i), end="\t")
    print()
# 水仙花数
for numbers2 in range(100, 1000):
    a = numbers2 % 10
    b = numbers2 // 10 % 10
    c = numbers2 // 100
    if a ** 3 + b ** 3 + c ** 3 == numbers2:
        print(numbers2)
